import http from '@/utils/request'

export function saveInfo(data) {
  return http.request({
    url: '/quarantineInfo/saveInfo',
    method: 'post',
    data
  })
}
export function pageInfoList(data) {
  return http.request({
    url: '/quarantineInfo/pageInfoList',
    method: 'post',
    timeout: 5000,
    data
  })
}

export function quarantineDetail(params) {
  return http.request({
    url: '/quarantineInfo/quarantineDetail',
    method: 'post',
    params
  })
}

export function updateInfo(data) {
  return http.request({
    url: '/quarantineInfo/updateInfo',
    method: 'post',
    data
  })
}
export function deleteInfo(params) {
  return http.request({
    url: '/quarantineInfo/deleteInfo',
    method: 'post',
    params
  })
}
export function getCreateId(params) {
  return http.request({
    url: '/quarantineInfo/getInfoByAuthCode',
    method: 'post',
    params
  })
}

export function queryClick(data) {
  return http.request({
    url: '/quarantineRecord/queryClick',
    method: 'post',
    data
  })
}
export function list(params) {
  return http.request({
    url: '/sysDictData/list',
    method: 'get',
    params
  })
}
export function updateQuarantineStatus(data) {
  return http.request({
    url: '/quarantineInfo/updateQuarantineStatus',
    method: 'post',
    data
  })
}

export function clickClock(data) {
  return http.request({
    url: '/quarantineRecord/click',
    method: 'post',
    data
  })
}
export function pageReportInfo(params) {
  return http.request({
    url: '/quarantineInfo/pageReportInfo',
    method: 'post',
    params
  })
}

// 所属辖区隔离总人数
export function countIsolate(params) {
  return http.request({
    url: '/screen/countIsolate',
    method: 'get',
    timeout: 20000,
    params
  })
}

export function removeCount(params) {
  return http.request({
    url: '/screen/removeCount',
    method: 'get',
    timeout: 20000,
    params
  })
}
// 所属辖区隔离人员始发地统计
export function countSituationByFromArea(params) {
  return http.request({
    url: '/screen/countSituationByFromArea',
    method: 'get',
    timeout: 20000,
    params
  })
}
// 所属辖区隔离类型统计
export function countSituationByType(params) {
  return http.request({
    url: '/screen/countSituationByType',
    method: 'get',
    timeout: 20000,
    params
  })
}
// 所属辖区新增统计情况
export function countSituationNewAdd(params) {
  return http.request({
    url: '/screen/countSituationNewAdd',
    method: 'get',
    timeout: 20000,
    params
  })
}

export function countRoomReport(params) {
  return http.request({
    url: '/screen/countRoomReport',
    method: 'get',
    timeout: 20000,
    params
  })
}
// 所属辖区解除隔离统计情况
export function queryQuarantineDetail(params) {
  return http.request({
    url: '/screen/queryQuarantineDetail',
    method: 'get',
    timeout: 20000,
    params
  })
}
export function queryInfo(data) {
  return http.request({
    url: '/quarantineInfo/queryInfoByKeyWords',
    method: 'post',
    data
  })
}

export function countAreaScope(params) {
  return http.request({
    url: '/screen/countAreaScope',
    method: 'get',
    timeout: 20000,
    params
  })
}

export function cumulativeCountAreaScope(params) {
  return http.request({
    url: '/screen/cumulativeCountAreaScope',
    method: 'get',
    timeout: 20000,
    params
  })
}

export function daily(params) {
  return http.request({
    url: '/screen/daily',
    method: 'get',
    timeout: 20000,
    params
  })
}

export function getQuarantineInfoByScanCode(params) {
  return http.request({
    url: '/healthCode/getQuarantineInfoByScanCode',
    method: 'get',
    params
  })
}

export function getUserList(params) {
  return http.request({
    url: '/sysUserRole/getUserList',
    method: 'get',
    params
  })
}

export function organizationMenuTree(params) {
  return http.request({
    url: '/sysUserRole/organizationMenuTree',
    method: 'get',
    params
  })
}

// 用户授权
export function AuthOrganizationRole(data) {
  return http.request({
    url: '/sysUserRole/AuthOrganizationRole',
    method: 'post',
    data
  })
}

// 新增用户
export function addUserInfo(data) {
  return http.request({
    url: '/sysUserRole/addUserInfo',
    method: 'post',
    data
  })
}
export function addOrganization(data) {
  return http.request({
    url: '/sysUserRole/addOrganization',
    method: 'post',
    data
  })
}

export function updateOrganization(data) {
  return http.request({
    url: '/sysUserRole/updateOrganization',
    method: 'put',
    data
  })
}
export function updateStatusBatch(data) {
  return http.request({
    url: '/quarantineRoom/updateStatusBatch',
    method: 'post',
    data
  })
}
export function deleteUser(phone) {
  return http.request({
    url: `/sysUserRole/deleteUser/${phone}`,
    method: 'delete'
  })
}

export function updateUserInfo(data) {
  return http.request({
    url: `/sysUserRole/updateUserInfo`,
    method: 'put',
    data
  })
}

export function organizationMenuTreeAll(params) {
  return http.request({
    url: '/sysUserRole/organizationMenuTreeAll',
    method: 'get',
    params
  })
}

export function checkCardNum(data) {
  return http.request({
    url: '/quarantineInfo/checkCardNum',
    method: 'post',
    data
  })
}

export function deleteOrganization(id) {
  return http.request({
    url: `/sysUserRole/deleteOrganization/${id}`,
    method: 'delete'
  })
}

export function quarantineRoom(params) {
  return http.request({
    url: `/quarantineRoom/list`,
    method: 'get',
    params
  })
}
export function addRoom(data) {
  return http.request({
    url: `/quarantineRoom/add`,
    method: 'post',
    data
  })
}

export function updateRoom(data) {
  return http.request({
    url: `/quarantineRoom/update`,
    method: 'post',
    data
  })
}
export function deleteRoom(id) {
  return http.request({
    url: `/quarantineRoom/delete/${id}`,
    method: 'delete'
  })
}
